﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.Customers>" %>


<% Html.DevExpress().GridView(settings =>
                                    {
                                        settings.Name = "gdLegalEntities";
                                        settings.KeyFieldName = "IdLegalEntity";

                                        settings.CallbackRouteValues =
                                          new { Controller = "Customers", Action = "CustomerLegalEntities_Edit", customerId = Model.IdCustomer };
                                        settings.SettingsEditing.UpdateRowRouteValues = new { Controller = "Customers", Action = "CustomerLegalEntitiesUpdate", customerId = Model.IdCustomer };
                                        settings.SettingsEditing.AddNewRowRouteValues = new { Controller = "Customers", Action = "CustomerLegalEntitiesAdd" };
                                        settings.SettingsEditing.DeleteRowRouteValues = new { Controller = "Customers", Action = "CustomerLegalEntitiesDelete", customerId = Model.IdCustomer };

                                        // settings.Columns.Add(column =>
                                        //{
                                        //    column.Caption = Resourses.LegalEntityName;
                                        //    column.FieldName = "Name";
                                            
                                        //});
                                        settings.Columns.Add("Name");
                                        
                                        settings.SettingsPager.PageSize = 20;

                                        settings.CommandColumn.Visible = true;
                                        settings.CommandColumn.NewButton.Visible = true;
                                        settings.CommandColumn.DeleteButton.Visible = true;
                                        settings.CommandColumn.EditButton.Visible = true;
                                        settings.SettingsBehavior.ConfirmDelete = true;
                                        settings.Settings.ShowFilterRow = true;


                                      //  settings.Settings.ShowVerticalScrollBar = true;
                                        //settings.Settings.VerticalScrollableHeight = 350;
                                        //settings.Settings.VerticalScrollBarStyle = GridViewVerticalScrollBarStyle.Virtual;
                                        settings.ControlStyle.Paddings.Padding = System.Web.UI.WebControls.Unit.Pixel(0);
                                        settings.ControlStyle.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
                                        settings.ControlStyle.BorderBottom.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);

                                        settings.SettingsEditing.Mode = GridViewEditingMode.EditFormAndDisplayRow;
                                        settings.Width = Unit.Percentage(100);
                        
                                       
                                        
                                    }

    ).Bind(Model.LegalEntities).Render();               %>